package render.graph
{
	import mx.core.UIComponent;
	
	public class Node
	{
		public static const ATTR:int = 0;
		public static const ENTITY:int = 1;
		
		private var _type:int = ENTITY;
		private var _text:String;
		private var _fetchDone:Boolean = false;
		
		public var x:Number = 0;
		public var y:Number = 0;
		public var dx:Number= 0;
		public var dy:Number= 0;
		public var id:int;
		
		public var display:UIComponent;
		
		public function Node(id:int,text:String)
		{
			this.id = id;
			_text = text;
		}
		public function get text():String
		{
			return _text;
		}
		public function set type(type:int):void
		{
			_type = type;
		}
		public function get type():int
		{
			return _type;
		}
		public function refresh():void
		{
			x = display.x;
			y = display.y;
		}
		public function commit():void
		{
			display.x = x;
			display.y = y;
		}
		public function get fetchDone():Boolean
		{
			return _fetchDone;
		}
		public function set fetchDone(bool:Boolean):void
		{
			_fetchDone = bool;
		}
		public function solid():void
		{
			_fetchDone = true;
		}
	}
}